/*-------------------------------------------------------- 
* Module Name : OLAppTemplateDefs
* Version : 1.0
* 
* Software Name : Qt App Template
* Version : 1.0
*
* Copyright � 2010 � 2011 France T�l�com
* This software is distributed under the LGPL v2.1 license,
* the text of which is available at http://www.gnu.org/licenses/lgpl-2.1.html
* or see the "LICENSE.txt" file for more details.
*
*--------------------------------------------------------
* File Name   : OLAppTemplateDefs.h
*
* Created     : 07 June 2011
* Author(s)   : Omer Saleem
*
* Description :
* File for providing the 'magic' numbers and styling for
* applying the look and feel of UI elements.
*
*--------------------------------------------------------
* 1.0 - First open source release
*
*/

#ifndef APPTEMPLATEDEFS_H
#define APPTEMPLATEDEFS_H

#include <QLinearGradient>

const int APP_WIDTH = 360;
const int APP_HEIGHT = 640;

#ifdef Q_OS_SYMBIAN
const int FINGER_SIZE = 50;
#elif defined Q_WS_MAEMO_5
const int FINGER_SIZE = 60;
#else
const int FINGER_SIZE = 50;
#endif

const int INFOBAR_HEIGHT = 18;
const int STATUSBAR_HEIGHT = FINGER_SIZE+1;
const int TOOLBAR_HEIGHT = FINGER_SIZE + (FINGER_SIZE/2);
const int MAX_MENUITEMS = 6;

const int MENUPANE_WINDOWPADDING = 10;
const int MENUPANE_OFFSET = -4;

#ifdef Q_OS_SYMBIAN
const int FONT_SIZE = 18;
#elif defined Q_WS_MAEMO_5
const int FONT_SIZE = 18;
#else
const int FONT_SIZE = 16;
#endif

//#define BLUETHEME
#define ORANGETHEME
#ifdef ORANGETHEME
class OLStyles
{
public:
    static QBrush toolbarBackgroundBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(150,150,150));
        gradient.setColorAt(0.48, QColor(51,51,51));
        gradient.setColorAt(0.52, QColor(0,0,0));
        gradient.setColorAt(1.0, QColor(0,0,0));

        return QBrush(gradient);
    }

    static QBrush buttonHighlightBrush(const QRect& rect) {
//        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        // aqua color
//        gradient.setColorAt(0, QColor(51,51,51));
//        gradient.setColorAt(0.5, QColor(54,140,136));
//        gradient.setColorAt(1.0, QColor(54,140,136));

        //orange color
//        gradient.setColorAt(0, QColor(255,102,0));
//        gradient.setColorAt(0.5, QColor(255,102,0));
//        gradient.setColorAt(1, QColor(255,153,0));
        return QBrush(QColor(255,153,0));
    }

    static QBrush buttonBackgroundBrush(const QRect& rect) {
//        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

//        gradient.setColorAt(0, QColor(170,170,170));
//        gradient.setColorAt(0.7, QColor(80,80,80));
//        gradient.setColorAt(1.0, QColor(80,80,80));

        return QBrush(QColor(39,39,39));
    }

    static QBrush buttonBackgroundHighlightBrush(const QRect& rect) {
//        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

//        gradient.setColorAt(0, QColor(0x1E90FF));
//        gradient.setColorAt(0.5, QColor(0x87CEEB));
//        gradient.setColorAt(1.0, QColor(0x87CEFA));
//        gradient.setColorAt(0, QColor(255,102,0));
//        gradient.setColorAt(0.5, QColor(255,102,0));
//        gradient.setColorAt(1, QColor(255,153,0));

        return QBrush(QColor(255,153,0));
    }

    static QColor buttonBorder() {
        return QColor(39,39,39);
    }

    static QColor buttonHighlightBorder() {
        return QColor(255,153,0);
    }

    static QColor buttonSeparator() {
        return QColor(99,99,99);
    }

    static QColor textColor() {
        return QColor(Qt::white);
    }

    static QColor textHighlightColor() {
        return QColor(64,64,64);
    }

};
#elif defined BLUETHEME
class OLStyles
{
public:
    static QBrush toolbarBackgroundBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(150,150,150));
        gradient.setColorAt(0.48, QColor(80,80,80));
        gradient.setColorAt(0.52, QColor(30,30,30));
        gradient.setColorAt(1.0, QColor(0,0,0));

        return QBrush(gradient);
    }

    static QBrush buttonHighlightBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(0x1E90FF));
        gradient.setColorAt(0.5, QColor(0x87CEEB));
        gradient.setColorAt(1.0, QColor(0x87CEFA));

        return QBrush(gradient);
    }

    static QBrush buttonBackgroundBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(170,170,170));
        gradient.setColorAt(0.7, QColor(80,80,80));
        gradient.setColorAt(1.0, QColor(80,80,80));

        return QBrush(gradient);
    }

    static QBrush buttonBackgroundHighlightBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(0x1E90FF));
        gradient.setColorAt(0.5, QColor(0x87CEEB));
        gradient.setColorAt(1.0, QColor(0x87CEFA));

        return QBrush(gradient);
    }

    static QColor buttonBorder() {
        return QColor(120,120,120);
    }

    static QColor buttonHighlightBorder() {
        return QColor(0x87CEEB);
    }

    static QColor buttonSeparator() {
        return QColor(99,99,99);
    }

    static QColor textColor() {
        return QColor(Qt::white);
    }

    static QColor textHighlightColor() {
        return QColor(64,64,64);
    }
};
#else
class OLStyles
{
public:
    static QBrush toolbarBackgroundBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(150,150,150));
        gradient.setColorAt(0.48, QColor(80,80,80));
        gradient.setColorAt(0.52, QColor(30,30,30));
        gradient.setColorAt(1.0, QColor(0,0,0));

        return QBrush(gradient);
    }

    static QBrush buttonHighlightBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(0,0,0));
        gradient.setColorAt(0.45, QColor(30,30,30));
        gradient.setColorAt(0.55, QColor(80,80,80));
        gradient.setColorAt(1, QColor(150,150,150));

        return QBrush(gradient);
    }

    static QBrush buttonBackgroundBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());

        gradient.setColorAt(0, QColor(170,170,170));
        gradient.setColorAt(0.7, QColor(80,80,80));
        gradient.setColorAt(1.0, QColor(80,80,80));

        return QBrush(gradient);
    }

    static QBrush buttonBackgroundHighlightBrush(const QRect& rect) {
        QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());
        gradient.setColorAt(0, QColor(80,80,80));
        gradient.setColorAt(0.3, QColor(80,80,80));
        gradient.setColorAt(1, QColor(170,170,170));

        return QBrush(gradient);
    }

    static QColor buttonBorder() {
        return QColor(120,120,120);
    }

    static QColor buttonHighlightBorder() {
        return QColor(120,120,120);
    }

    static QColor buttonSeparator() {
        return QColor(99,99,99);
    }

    static QColor textColor() {
        return QColor(Qt::white);
    }

    static QColor textHighlightColor() {
        return QColor(64,64,64);
    }
};

#endif // BLUETHEME

#endif // APPTEMPLATEDEFS_H
